package org.testmyapp.tasks;

import java.util.Date;

public class TaskWorkersCommon {
	
	private static Integer maxSum = 100000000;

	public static Date parseDateFromString(String dateString) {
		String[] dateStringArr = dateString.split("\\.");
		Integer[] dateIntArr = new Integer[3];

		try {
			for (int i = 0; i < 3; i++) {
				dateIntArr[i] = Integer.parseInt(dateStringArr[i]);
			}
			@SuppressWarnings("deprecation")
			Date date = new Date(dateIntArr[2] - 1900, dateIntArr[1] - 1,
					dateIntArr[0]);
			return date;
		} catch (Exception e) {
			throw new RuntimeException("Cant parse Date");
		}
	}
	
	public static boolean validateSum(Integer i) {
		if(i <= maxSum) {
			return false;
		}
		return true;
	}
	
}
